Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix switching windows with the 'Go' menu #322

Merged
merged 1 commit into from
Nov 21, 2020

Conversation

takluyver
Copy link
Collaborator

Description

Start Gourmet, and open a recipe. Then try to switch between the open windows with the 'Go' menu. Switching to a recipe card fails with TypeError: show() takes 1 positional argument but 2 were given. This PR fixes that, so you the menu entry works as expected.

The issue is that the signal mechanism is passing an argument, but the RecCard.show() method doesn't expect one. The solution, already used elsewhere in the code, is to wrap it in a lambda which discards the argument(s).

How Has This Been Tested?

Followed the above steps manually.

Screenshots (if appropriate):

screenshot showing the Go menu

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@takluyver takluyver added the GUI label Nov 21, 2020
@@ -200,7 +200,7 @@ def go_menu (self):
separator.show()
for rc in list(self.rc.values()):
i=Gtk.MenuItem("_%s"%rc.current_rec.title)
i.connect('activate',rc.show)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking further after I committed, I think this is dead code, and only the change below made a difference.

@cydanil
Copy link
Collaborator

cydanil commented Nov 21, 2020

Nice catch, thanks!

@cydanil cydanil merged commit ed1013b into kirienko:master Nov 21, 2020
@takluyver takluyver deleted the fix-go-menu branch November 21, 2020 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants